The present invention relates to the field of digital video, and in particular to digital video broadcasting.
Scrambling techniques are commonly used in video applications such as payment-on-demand cable TV. A common technique for scrambling analogue video signals is to randomise the position of the horizontal synchronisation pulse. Frequently, an incoming video signal will contain sections of scrambled video interleaved with sections of unscrambled video and it is necessary to distinguish between them in the processing circuitsxe2x80x94see for example U.S. Pat. No. 4,926,477.
As regards digital broadcasting (DVB) various standards have been set, and in particular a standard has been set, known as the Common scrambling specifications devised by the European project for digital video broadcasting, concerning the scrambling and descrambling of data (the DVB algorithm). Essential characteristics of the DVB algorithm are shown in FIG. 1. A packet 2 of data having a header field HEADER followed by n consecutive blocks (of 8 bytes) of scrambled data SB(n) is applied to a stream cipher 4, of a form defined by the common scrambling specifications. The scrambled data is deciphered on a block by block basis with the first block SB(1) being used for initialisation, and each subsequent block being subject to the stream cipher CB and then passed as an intermediate block IB(n) to a block cipher unit 6, also of a form defined by the common scrambling specification. Each block is subject to a block deciphering operation BD and descrambled blocks DB(n) are output for assembly into a descrambled packet 8.
A more specific implementation of the descrambler of FIG. 1 is shown in FIG. 2, wherein scrambled data is applied to a stream cipher unit 10 and a first input of an exclusive OR gate 12. The output of cipher unit 10 is applied to a second input of gate 12. The output of gate 12 is applied to an 8 byte register 14 (herein referred to as Reg1), which provides an 8 byte delay. A parallel output of Reg1 is coupled to a block cipher unit 16. A serial output of Reg1 is coupled via a two way switch 18 to an 8 byte register 20 (providing a further 8 byte delayxe2x80x94referred to herein as Reg2) and to a first input of an exclusive OR gate 22. The output of block cipher unit 16 is connected as a parallel input to Reg2 and a serial output of Reg2 is applied to a second input of exclusive OR gate 22. The output of gate 22 provides descrambled data. It will be understood that the presence of the two registers Reg1, Reg2 in the data path stream creates substantial 16 byte delay. The notation in FIG. 2 is as follows:
k indexes scrambled bytes through the stream
p end of a scrambled field
n number of complete 8 bytes blocks in a scrambled field
r the residue that is left in a scrambled field after the last complete 8 byte block of that scrambled field
For compressed video signals, compressed according to the MPEG standards, the application of the DVB descrambler algorithm to MPEG transport data streams requires that the fields of scrambled data contained in the received transport stream be extracted from the stream, descrambled according to the DVB descrambler algorithm, then reinserted into their original place in the received transport stream.
Where the transport stream contains interleaved sections of scrambled video and unscrambled video (plain text) a problem therefore arises in that the descrambling of the scrambled sections naturally introduces a time delay and it is not therefore possible to reinsert the descrambled sections to their original place in the transport steam without further modification of the receiving system.
It is an object of the invention to provide a simple and inexpensive means of descrambling scrambled data in a transport stream containing sections of both scrambled and unscrambled data.
In accordance with the present invention, there is provided apparatus for processing a stream of digital video broadcast data containing interleaved sections of scrambled data and unscrambled data, the apparatus including a common data flow path provided both for sections of scrambled data and sections of unscrambled data, one or more data flow path loops extending from and back to said common data flow path and containing cipher means to enable the descrambling of scrambled data, and a control means capable of assuming a plurality of control states for selectively controlling the passage of data through the data flow paths to enable passage of unscrambled data sections in said common data flow path and descrambling of scrambled data sections in said data flow loops, while maintaining the relative positions of the data sections in this data stream.
In accordance with the invention, since a single main data flow path is provided, with control of the main data flowpath and the data flow path loops, the passage of unscrambled sections and scrambled sections of data can be regulated to avoid problems of reinsertion of descrambled data and resynchronisation to a single data stream.
The present invention provides in a specific aspect apparatus for processing digital video broadcast data comprising interleaved sections of scrambled and unscrambled data, the apparatus comprising:
a data input terminal coupled to a first input of an exclusive OR gate means, a stream cipher means having an input connected to said data input terminal and an output connected to a second input of the exclusive OR gate means;
a first shift register means having an input coupled to receive the output of the exclusive OR gate means, and having first and second outputs, a second shift register means having a first input coupled to the first output of the first shift register means, and having a second input and an output, a block cipher means coupled between the second output of the first shift register means and the second input of the second shift register means; and
a control means responsive to whether data at said data input terminal is scrambled data or unscrambled data for selectively enabling said stream cipher means, block cipher means and first and second shift register means (a) to pass an unscrambled data directly through said first and second shift register means and (b) to pass scrambled data through said stream and block cipher means.
In accordance with the invention, since a single data flow path is provided a more secure, reliable and inexpensive system is provided. Whilst other arrangements may be envisaged for example splitting the data into completely separate data flow paths for scrambled and unscrambled data with appropriate delays in the flow paths to maintain correct timing relationships, this would result in a more expensive system.
The single data stream path in accordance with the invention is preferably arranged that it cannot pass both a scrambled byte of data and a non-scrambled data and that further the two shift register means do not contain gaps between successive fields of data. These two conditions mean that scrambled and non-scrambled fields follow each other without either a gap or an overlap, in data (but not necessarily in time intervals), and since the non-scrambled data uses the same shift register means, providing a 16 byte time delay as is used by the scrambled data, the problem of inserting non-scrambled data into the descrambled data stream does not arise and is automatically solved.
The control means preferably comprises a control state machine, preferably occupying a number of predefined states in which it issues appropriate control signals to control the data stream. As preferred a key state machine is provided for controlling the issuing of keys to the cipher means for the descrambling process. A packet counter is preferably provided to count the number of bytes of the current signal packet of the incoming data stream up to a maximum of 184 bytes as permitted by MPEG-2. A first block counter is provided to count the number of bytes of a new scrambled field modulo 8; this counter controls said first shift register means. As preferred a second block counter is provided to count the bytes of a second block of data of a new scrambled field modulo 8. Two block counters are needed since there may be less than 8 bytes of unscrambled data between two successive scrambled fields.